package xiaohu.day0.HJ2;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            String str = scanner.nextLine().toLowerCase();
            String alC = scanner.nextLine().toLowerCase();
            System.out.println(str.length()-str.replaceAll(alC,"").length());
        }
    }
}
